package com.gz.service;

import com.gz.dao.EmployeeDao;
import com.gz.domain.Employee;

public class EmployeeService {
    /**
     * 该类完成对表employee 的各种操作(通过调用EmployeeDao对象实现)
     */

    //定义一个EmployeeDao属性
    private EmployeeDao employeeDao=new EmployeeDao();

    //方法，根据empId和pwd返回一个Employee对象
    //如果查询不到就返回null
    public Employee getEmployeeByempIdandPwd(String empId,String pwd){
        Employee employee = employeeDao.querySingle(
                "select * from employee where empId=? and pwd=md5(?)", Employee.class, empId, pwd);
        return employee;
    }
}
